//
//  JRASIInputStream.h
//  Part of JRASIHTTPRequest -> http://allseeing-i.com/JRASIHTTPRequest
//
//  Created by Ben Copsey on 10/08/2009.
//  Copyright 2009 All-Seeing Interactive. All rights reserved.
//

#import <Foundation/Foundation.h>

@class JRASIHTTPRequest;

// This is a wrapper for NSInputStream that pretends to be an NSInputStream itself
// Subclassing NSInputStream seems to be tricky, and may involve overriding undocumented methods, so we'll cheat instead.
// It is used by JRASIHTTPRequest whenever we have a request body, and handles measuring and throttling the bandwidth used for uploading

@interface JRASIInputStream : NSObject<NSStreamDelegate>

+ (id)inputStreamWithFileAtPath:(NSString *)path request:(JRASIHTTPRequest *)request;
+ (id)inputStreamWithData:(NSData *)data request:(JRASIHTTPRequest *)request;
- (id)initWithInputStream:(NSInputStream *)stream;

@property (assign, nonatomic) JRASIHTTPRequest *request;
@end
